Skip to content

PYTHON-5886 - Fix synchro bug caused by ruff upgrade#2878

Open
NoahStapp wants to merge 3 commits into
mongodb:masterfrom
NoahStapp:PYTHON-5886
Open

PYTHON-5886 - Fix synchro bug caused by ruff upgrade#2878
NoahStapp wants to merge 3 commits into
mongodb:masterfrom
NoahStapp:PYTHON-5886

Conversation

@NoahStapp

Copy link
Copy Markdown
Contributor

PYTHON-5886

Changes in this PR

Fixes the synchro.py script to properly synchronize after the changes caused by ruff linting.

Test Plan

Checklist

Checklist for Author

  • Did you update the changelog (if necessary)?
  • Is there test coverage?
  • Is any followup work tracked in a JIRA ticket? If so, add link(s).

Checklist for Reviewer

  • Does the title of the PR reference a JIRA Ticket?
  • Do you fully understand the implementation? (Would you be comfortable explaining how this code works to someone else?)
  • Is all relevant documentation (README or docstring) updated?

Copilot AI review requested due to automatic review settings June 16, 2026 19:42
@NoahStapp NoahStapp requested a review from a team as a code owner June 16, 2026 19:42
@NoahStapp NoahStapp requested a review from aclark4life June 16, 2026 19:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the synchronization tooling and generated test files to account for formatting/lint changes introduced by a ruff upgrade, so tools/synchro.py can successfully regenerate the synchronous code/test tree from the asynchronous sources.

Changes:

  • Fix tools/synchro.py to correctly enumerate async source/test files using Path.iterdir() entries (avoiding path duplication) and correctly detect async-only tests by filename.
  • Update several sync/async mirrored tests to include additional # noqa codes (RUF100, etc.) to satisfy newer ruff behavior.
  • Minor variable rename in a test to avoid an unused binding.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tools/synchro.py Fixes file discovery and async-only test filtering so synchro can run after ruff-driven formatting changes.
test/utils_spec_runner.py Adjusts # noqa list to align with ruff’s handling of unused noqa directives.
test/test_pooling.py Adds RUF100 to # noqa to avoid ruff unused-noqa failures in the sync mirror.
test/test_encryption.py Regenerated change in a range-query prose test (currently introduces a likely logic bug in Case 7).
test/test_client_metadata.py Renames an unused tuple element to _metadata for lint cleanliness.
test/asynchronous/utils_spec_runner.py Adds RUF100 to align with sync mirror and ruff behavior.
test/asynchronous/test_pooling.py Adds RUF100 to align with sync mirror and ruff behavior.

Comment thread test/test_encryption.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Comment thread .evergreen/scripts/generate_config_utils.py Outdated
Comment thread .evergreen/generated_configs/variants.yml Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@blink1073

Copy link
Copy Markdown
Member

Did you mean to cancel a few of the jobs?

):
await self.client_encryption.encrypt(
6 if cast_func is int else float(6),
6 if cast_func is not int else float(6),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had this test been corrupted by the previous PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants